/*
package com.css.gateway.config;

import com.invoice.tcc.config.interceptor.ApiAccessInterceptor;
import com.invoice.tcc.filter.SecurityFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.servlet.Filter;

@Configuration
public class FilterConfiguration implements WebMvcConfigurer {


    @Bean
    public FilterRegistrationBean<SecurityFilter> znsbSessionFilter() {
        return createFilterBean(new SecurityFilter(), -98);
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(apiAccessInterceptor()).addPathPatterns("/**");
    }

    //    @Bean
//    public FilterRegistrationBean<SessionFilter> sessionFilter() {
//        return createFilterBean(new SessionFilter(), -99);
//    }

    @Bean
    public HandlerInterceptor apiAccessInterceptor () {
        return new ApiAccessInterceptor();
    }

    public static <T extends Filter> FilterRegistrationBean<T> createFilterBean(T filter, Integer order) {
        FilterRegistrationBean<T> bean = new FilterRegistrationBean<>(filter);
        bean.setOrder(order);
        return bean;
    }

}
*/
